<template>
  <el-button size="small" @click="outExcel">
    <div class="out-btn">
      <img class="img" src="@/assets/images/form/excel-out.png" alt="out" v-if="!isExcelLoading" />
      <span class="text" v-if="!isExcelLoading">导出Excel</span>
      <span class="text" v-if="isExcelLoading"> <i class="el-icon-loading"></i> 导出中...</span>
    </div>
  </el-button>
</template>
<script>
export default {
  name: "ExcelButton",
  props: {
    isExcelLoading: {
      type: Boolean,
      default: false
    }
  },
  data() {
    return {};
  },
  mounted() {},
  methods: {
    outExcel() {
      !this.isExcelLoading && this.$emit("outExcel");
    },
  },
};
</script>
<style lang="scss" scoped>
.out-btn {
  display: flex;
  justify-content: center;
  align-items: center;
  .img {
    height: 12px;
  }
  .text {
    margin-left: 3px;
    font-weight: bold;
    i {
      font-size: 12px;
    }
  }
}
</style>
